package com.quanyan.user.constants;

import com.quanyan.common.utils.DateUtils;

/**
 * Created by Administrator on 2016/6/13.
 */
public class UserConstants {

    /**
     * 系统名
     */
    public static final String C = "USER";

    /**
     * 手机号与UID映射KEY
     */
    public static final String FAMILY_MOBILE = "MOBILE_UID_KEY_UPDATE:";
    /**
     *微信与UID映射KEY
     */
    public static final String FAMILY_WX_OPENID="WX_UID_KEY_UPDATE:";


    /**
     * 存放用户信息HASH的KEY
     */
    public static final String UID_MAP = "UID_MAP";

    /**
     * 存放用户信息HASH的KEY 拓展信息
     */
    public static final String UID_MAP_EXT = "UID_EXT_MAP:";

    /**
     * 存放用户信息HASH的KEY 等级信息
     */
    public static final String UID_MAP_LEVEL = "UID_LEVELS_MAP:";

    /**
     * 存放用户详细信息HASH的KEY
     */
    public static final String UID_USERINFO = "UID_USERINFO";

    /**
     * 用户兴趣KEY
     */
    public static final String USER_INTEREST_KEY = "USER_INTEREST_KEY";

    /**
     * 环信token key
     */
    public static final String HUANXIN_TOKEN_KEY = "HUANXIN_TOKEN_KEY";

    /**
     * 系统消息通知图标url
     */
    public static final String SYSTEM_MESSAGE_URL = "http://quncao.b0.upaiyun.com/system/message/default/lark_f0bd80fb35f46bed00a15f1aebcb043b.png";


    /**
     * 用户类型
     */
    public static final Integer USER_VISITOR = 1;//游客

    public static final Integer USER_REGISTER = 2;//注册

    public static final byte USER_INTEREST_IS_REGISTER = 1;//已注册

    public static final byte USER_INTEREST_IS_NOT_REGISTER = 0;//未注册

    public static final byte USER_INTEREST_IS_DELETE = 1;//已删除

    public static final byte USER_INTEREST_IS_NOT_DELETE = 0;//未删除

    public static final byte USER_INTEREST_IS_OBTAIN = 1;//选定

    public static final byte USER_INTEREST_IS_NOT_OBTAIN = 0;//未选


    public static final byte IS_DELETE_S = 1; // 正常

    public static final byte IS_DELETE_Y = 0; // 删除

    /**
     * 新手任务
     */
    public static final byte NEW_HAND_TASK = 1;

    /**
     * 日常任务
     */
    public static final byte DAY_TASK = 2;


    /**
     * 系统任务
     */
    public static final String UC_SYS_TASK = "UC_SYS_TASK:";

    /**
     *
     */
    public static final String UC_SYS_BOX = "UC_SYS_BOX:";


    public static final class ReceiveType{

        /**
         * 新手任务
         */
        public static final byte NEW_HAND_TASK = 1;

        /**
         * 任务
         */
        public static final Integer DAY_TASK = 2;

        /**
         * 宝箱
         */
        public static final Integer BOX = 3;
    }


    /**
     *任务状态
     */
    public static final class TaskStatus{

        public static final byte COMPLETE_ING = 0; //未完成

        public static final byte COMPLETED = 1; // 领取

        public static final byte RECEIVED = 2; // 已领取
    }

    /**
     *宝箱状态
     */
    public static final class BoxStatus{

        /**
         * 已开启 已领取
         */
        public static final byte OPEN_YES_RECEIVE = 2;

        /**
         *  已开启 未领取
         */
        public static final byte OPEN_NO_RECEIVE = 1;

        /**
         *  未开启
         */
        public static final byte OPEN_FALSE = 0;


    }

    /**
     *宝箱等级
     */
    public static final class BoxLevel{

        /**
         *1
         */
        public static final Integer level_f = 1;

        /**
         *  2
         */
        public static final Integer level_s = 2;

        /**
         *  3
         */
        public static final Integer level_t = 3;


    }

    /**
     * 用户当日任务key
     * @param uid
     * @return
     */
    public static String getUserTaskRedisKey(int uid){
        return  uid + "_task_" + DateUtils.getDateToStringYYYY_MM_DD()+":";
    }

    /**
     * 用户当日箱子key
     * @param uid
     * @return
     */
    public static String getUserBoxRedisKey(int uid){
        return  uid + "_box_" + DateUtils.getDateToStringYYYY_MM_DD()+":";
    }


    /**
     * 俱乐部活动
     */
    public static final Integer  ACTIVITY_TYPE_CLUB = 1;

    /**
     * 户外活动
     */
    public static final Integer  ACTIVITY_TYPE_OUTDOOR = 2;



    public static final String USER_TASK_GROUP = "USER_TASK_GROUP";

    public static final String USER_TASK_GROUP_INSTANCE = "USER_TASK_INSTANCE";




    public static final class UserInvite{

        /**
         * 未领取
         */
        public static final byte NO_RECEIVE = 0;

        /**
         *已经领取
         */
        public static final byte YES_RECEIVE = 1;


    }

    public static final String USER_CENTER_REGISTER_INVITE_TOPIC = "USER_CENTER_REGISTER_INVITE_TOPIC";
    public static final String USER_CENTER_REGISTER_INVITE_TAG = "USER_CENTER_REGISTER_INVITE_TAG";


    /**
     * 接收C++的kafka任务消息
     */
    public static final String USER_CENTER_KAFKA_C_USER_TASK = "USER_CENTEN_TASK_KAFKA";


    /**
     *
     */
    public static final String USER_TASK_COMPLETE_KEY = "USER_TASK_COMPLETE:";

    public static final String USER_TASK_COMPLETE_VALUE = "Y";

    public static final Byte USER_BASE_STATE_TRUE = 1;

    public static final Byte USER_BASE_STATE_FALSE = 0;



     /**
     * C++ setting redis key
     * @param uid
     * @return
     */
    public static String getUserSetting(Integer uid){
        return  "usersetting_"+uid.toString();
    }


    /**
     * 老用户
     */
    public static final byte OLD_USER = 1;

    /**
     * 新用户
     */
    public static final byte NEW_USER = 2;

    /**
     * 用户当日领取蛋壳总和
     * @param uid
     * @return
     */
    public static String getReceiveRedisKey(Integer uid){
        return  "user_receive_shell_" + DateUtils.getDateToStringYYYY_MM_DD() + uid.toString();
    }

    /**
     * 竞拍达人认证类型
     */
    public static final Integer IS_BIDS_VERIFY = 1;

    /**
     * 一口价达人认证类型
     */
    public static final Integer IS_BUYOUT_VERIFY = 2;

    /**
     * 竞拍、一口价双重认证
     */
    public static final Integer IS_BIDS_AND_BUYOUT_VERIFY = 3;

    /**
     * 取消竞拍达人认证
     */
    public static final Integer CANCEL_BIDS_VERIFY = 4;

    /**
     * 取消一口价达人认证
     */
    public static final Integer CANCEL_BUYOUT_VERIFY = 5;

    /**
     * 取消竞拍、一口价双重认证
     */
    public static final Integer CANCEL_BIDS_AND_BUYOUT_VERIFY = 6;

    /**
     * 俱乐部任务链接KEY
     */
    public static final String CLUB_TASK_URL_KEY = "CLUB_TASK_URL";


    /**
     * 用户信息key
     * @param uid
     * @return
     */
    public static String getUserRedisKey(Integer uid){
        if(uid != null )
             return "USER_INFO_KEY:" + uid.toString();
        return "";
    }

    /**
     * 用户详细信息key
     * @param uid
     * @return
     */
    public static String getUserDetailRedisKey(Integer uid){
        if(uid != null )
            return "USER_INFO_DETAIL_KEYS:" + uid.toString();
        return "";
    }


    /**
     * 用户拓展信息key
     * @param uid
     * @return
     */
    public static String getUserExtRedisKey(Integer uid){
        return "USER_INFO_EXT_KEY:" + uid.toString();
    }

    /**
     * 用户等级信息key
     * @param uid
     * @return
     */
    public static String getLevelRedisKey(Integer uid){
        return "User_Level_INFO:" + uid.toString();
    }


    /**
     *  好友信息key
     * @param uid
     * @param friendUid 好友id
     * @return
     */
    public static String getFriendRemark(Integer uid, Integer friendUid){
        return "FRIEND_UID_KEY:" + uid.toString() + friendUid.toString();
    }

    /**
     * 动态类型
     */
    public static final class DynamicType{
        /** 运动圈动态 **/
        public static int   loadNewsAll = 1;

        /** // 获取我关注的动态列表 **/
        public static int	loadNewsMyAttention = 2;

        /** 粉丝动态 **/
        public static int	loadNewsMyFans = 3;

        /** 我发布的的动态 **/
        public static int	loadNewsMyDy = 4;

        /** 话题动态 **/
        public static int	loadNewsTopicDy = 5;

        /** TA的动态 **/
        public static int	loadNewsTaDy = 6  ;

        /** 精选动态 **/
        public static int	choiceDy = 7  ;

        /** 俱乐部动态 **/
        public static int	clubDy = 8  ;

        /**发现栏目视频动态**/
        public static int  discoveryVideoDy = 9;


        /**发现栏目视频动态**/
        public static int  specialVideo = 10;


        /**发现栏目视频动态**/
        public static int  loadNewsMyAttentionDaren = 11;
    }

    /**
     * 动态模块缓存key
     */
    public static final class DynamicKey {
        /**缓存游客第一页精选动态列表key*/
        public static String NEWS_FIRST_TOURIST_KEY = "NEWS_FIRST_TOURIST_KEY";

        /**
         * 缓存用户第一页精选动态列表
         * @param uid
         * @return
         */
        public static String getNewsFirstUserKey(Integer uid ){
            return "NEWS_FIRST_USER:"+uid.toString();
        }
    }

    /**
     * 点赞
     */
    public static final byte PRAISE_ADD = 1 ;

    /**
     * 取消点赞
     */
    public static final byte PRAISE_CANCEL = 2 ;


    /**
     * 评论模块
     */
    public static final class ModuleType{

        /**
         * 动态模块
         */
        public static final Integer dynamic = 1;

        /**
         * 一口价模块
         */
        public static final Integer ykj = 1;


        /**
         * 竞拍模块
         */
        public static final Integer auction = 1;
    }

    /**
     * 直接评论
     */
    public static final int comment = 0;

    /**
     * 回复
     */
    public static final int comment_replay = 1;


    /**
     * DUPLICATE  更新 一行
     */
    public static final int duplicate_insert = 1;

    /**
     * DUPLICATE  更新 2行
     */
    public static final int duplicate_update = 2;

    /**
     * 用户安全级别-低
     */
    public static final byte SECURITY_LEVEL_LOW = 1;

    /**
     * 用户安全级别-高
     */
    public static final byte SECURITY_LEVEL_HIGH = 2;



    /**
     * 获取动态图片key
     * @return
     */
    public static String getDynamicImgKey(Integer dynamicId){
        return  "DynamicImages:"+dynamicId.toString();
    }



    /**
     * 获取赞key
     * @return
     */
    public static String getDynamicPraiseKey(Integer dynamicId){
        return  "DynamicPraises:"+dynamicId.toString();
    }

    /**
     * 获取版本信息Key
     * @return
     */
    public static String getVersionInfoKey() {
        return "VersionInfoRedisKey";
    }

    /**
     * 获取版本信息Field
     * @param version
     * @param osType
     * @return
     */
    public static String getVersionInfoField(Integer version,Integer osType,Integer appType){
        return version + "_" + osType + "_" + appType;
    }

    /**
     * 用户二维码缓存key
     * @param uid
     * @return
     */
    public static String getUserQRCodeKey(Integer uid){
        return "USER_QR_KEY_" + uid;
    }

    /**
     * 系统公共参数key
     * @param parameterKey
     * @return
     */
    public static String getCommonParamKey(String parameterKey){
        return "COMMON_PARAM_KEY_" + parameterKey;
    }

    /**
     * 系统公共参数field
     * @param extendInfo
     * @return
     */
    public static String getCommonParamExtend(String extendInfo){
        return "COMMON_PARAM_EXTEND_" + extendInfo;
    }



    /**
     * 动态类型
     */
    public static final class DynamicMoudleType{

        /**
         * 动态模块
         */
        public static final int app = 0;

        /**
         * 一口价模块
         */
        public static final int doyen = 1;

        /**
         * 俱乐部模块
         */
        public static final int club = 2;


    }

    /**
     * 账号类型
     */
    public static final class AccountType{
        public static final int WECHAT_OPEND_ID_TYPE = 1;

        public static final int WECHAT_UNION_ID_TYPE = 2;
    }

    /**
     * 第三方账号类型
     */
    public static final int WECHAT_TYPE = 1;



}
